function changeColor(e){
	x = document.querySelectorAll(".left_ul a")
	for (i=0;i<x.length;i++){
		x[i].style.color="#FFFFFF"
	}
	e.style.color="#409EFF"
}
function changeColor_1(e){
	x = document.querySelectorAll(".right_ul a")
	for (i=0;i<x.length;i++){
		x[i].style.color="#FFFFFF"
	}
	e.style.color="#409EFF"
	topic = e.getAttribute("date-index");
	var url = "/News/anaAjax?topic="+topic;
	console.log(url);
	loadPro(url);
	// console.log(url);
	
}
var monitor = 0
function fold(){
	if (monitor) {
		document.getElementsByClassName("right_ul")[0].style.display="none";
		monitor=0;
	}
	else{
		document.getElementsByClassName("right_ul")[0].style.display="block";
		monitor=1;
	}
}
var topic=0;
function doecharts(){
	var myChart = echarts.init(document.getElementById('media_ana'));
				option = {
					tooltip: {
						trigger: 'item',
						formatter: "{a} <br/>{b} : {c} ({d}%)"
					},
					legend: {
						orient: 'vertical',
						left: 'right',
						bottom: '1%',
						data: ['微博', '微信', '知乎', '新闻']
					},
					series: [{
						name: '情感占比',
						type: 'pie',
						radius: '50%',
						center: ['50%', '50%'],
						data: [{
								value: 335,
								name: '微博'
							},
							{
								value: 310,
								name: '微信'
							},
							{
								value: 234,
								name: '知乎'
							},
							{
								value: 135,
								name: '新闻'
							},
							
						],
						itemStyle: {
							emphasis: {
								shadowBlur: 10,
								shadowOffsetX: 0,
								shadowColor: 'rgba(0, 0, 0, 0.5)'
							}
						}
					}]
				};
				myChart.setOption(option);
}

function loadPro(url){
	var xhttp = new XMLHttpRequest();
	 xhttp.onreadystatechange = function(){
		 if(this.readyState==4 && this.status==200){
			 var jsonStr = xhttp.responseText;
			 console.log(jsonStr)
//			 doecharts();
		 }
	 }
	 xhttp.open("GET",url,true);
	 xhttp.send()
}		